<template>
    <div class="index-window border-shadow">
        <p class="quick-t"><i class="el-icon-document"></i>代办事项
            <el-button class="read-all" type="text" @click="dialogTodo = true">查看全部</el-button>
            <el-dialog title="代办事项" :visible.sync="dialogTodo">
            <div>
                <el-table :data="gridData.slice((currentPage-1)*pagesize,currentPage*pagesize)">
                    <el-table-column property="eText" label="代办事项" width="150"></el-table-column>
                    <el-table-column property="eSelect" label="所属系统" width="200"></el-table-column>
                    <el-table-column property="eStartTime" label="日期"></el-table-column>
                </el-table>
                <el-col :span="24" class="toolbar">
                    <el-pagination style="float:right" @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="currentPage"
                        :page-sizes="[5, 20, 50, 100]"
                        :page-size="pagesize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="gridData.length">
                    </el-pagination>
                </el-col>
            </div>
            </el-dialog>
        </p>
        <div class="window-box" style="display:block;padding:0 15px;">
            <ul>
                <li v-for="(item,index) in gridData" :key="index">
                    <p class="list-content">{{item.eText}}</p>
                    <div>{{item.eSelect}}<span>{{item.eStartTime}}</span></div>
                </li>
            </ul>
        </div>
    </div>
</template>
<style lang='scss'>
  /*引入无须编译的css文件*/
  @import '../../../assets/index.scss';
</style>
<script>
import axios from 'axios'
import { getDemoListPage } from '@/api/api';
  export default {
    data () { 
        return { 
        dialogTodo: false,
        gridData: [], 
        currentPage:1, 
        pagesize:5, 
        
        } 
    }, 
    methods: {
        getDemo() {//获取列表数据
            var _this = this;
            let para = { //参数
                currentpage:1,
                number:10,
                eSelectId:0,
                eText: "",
                eRadio:""
            };
            getDemoListPage(para).then((res) => {
                console.log("待办事项")
                console.log(res.data.result.row);
                _this.gridData =res.data.result.row; 
            });
        },
        handleSizeChange: function (size) { 
            this.pagesize = size; 
        }, 
        handleCurrentChange: function(currentPage){ 
            this.currentPage = currentPage; 
        }
    },
    mounted(){
      this.getDemo()
    } 
  };
</script>